
<template>
  <div   class="RepairTable" style="height:100%;width:100%;padding: 0;background-image: linear-gradient(to right top, #a1d1ff, #c2daff, #dce5ff, #f0f1ff, #ffffff);">
    <el-table
        :data="RepairTable"
        style="width: 100%">
      <el-table-column
          prop="buildingName"
          label="园区"
          width="180">
      </el-table-column>
      <el-table-column
          prop="roomName"
          label="房间"
          width="180">
      </el-table-column>
      <el-table-column
          prop="reason"
          label="维修原因"
          width="180">
      </el-table-column>
      <el-table-column
          prop="keeper"
          label="维修人员">
      </el-table-column>
      <el-table-column
          prop="state"
          label="维修状态">
      </el-table-column>
    </el-table>
    <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="pageNo"
        :page-sizes="[2,5,10]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total">
    </el-pagination>
  </div>
</template>
<script>
import {_getRepairTable} from '../../../api/student'
export default {
  created () {
    this.getRepairItem()
  },
  data () {
    return {
      RepairTable: [],
      pageSize: 10,
      pageNo: 1,
      total: null
    }
  },
  methods: {
    getRepairItem () {
      const DOT = {
        pageSize: this.pageSize,
        pageNo: this.pageNo,
        data: {
          student: JSON.parse(localStorage.getItem('user')).id.toString()
        }
      }
      _getRepairTable(DOT).then(res => {
        if (res.status) {
          this.RepairTable = res.data
          this.total = res.otherData.totalNum
        }
      })
    },
    handleSizeChange (val) {
      this.pageSize = val
      this.getRepairItem()
    },
    handleCurrentChange (val) {
      this.pageNo = val
      this.getRepairItem()
    }
  }
}

</script>
<style scoped>

</style>
